function Enum(enumObj) {
    return new Proxy(enumObj, {
      get(target, prop) {
        if (!Object.keys(target).includes(prop)) {
          throw new Error(`"${prop}" is not a valid enum key. Valid keys are: ${Object.keys(target).join(', ')}`);
        }
        return target[prop];
      },
      set(target, prop, value) {
        throw new Error('Enums are immutable and cannot be modified.');
      }
    });
  }

module.exports = {
    Enum
}